<?php

namespace App\Admin\Extensions;

use App\Model\User;
use Encore\Admin\Admin;

class ArticleOp extends BaseAction
{
    protected function render()
    {
        Admin::script($this->script($this->actionUrl));
        $userId = $this->row->reported_user_id;
        $notbtn = $this->buildButton('fail', '下架', ['id' => $this->id, 'status' => 0]);
        $okbtn = $this->buildButton('ok', '上架', ['id' => $this->id, 'status' => 1]);
        if ($this->row->flag == 1) $str = [$notbtn];
        else $str = [$okbtn];
        return implode('<br/><br/>', $str);
    }
}
